package ooday02;
//子类
public class Student extends Person{//Student继承了Person
    String clasName;//成员变量
    String stuId;
    Student(){
    }
    Student(String name,int age,String address,String className,String stuId){
        //super指代当前对象的超类对象
        super(name,age,address);

        this.clasName=className;
        this.stuId=stuId;
    }

    void study(){
        System.out.println(name+"正在踩缝纫机");
    }
    void play(String play){
        System.out.println(name+"正在和"+play+"打架");
    }
    //重写方法
    void sayHi(){
        System.out.println("大家好,我叫"+name+",今年"+age+"岁了,家住"+address+",班级为:"+clasName+",学号为:"+stuId);
    }

}
